const Controller = {
    data(){
        return {
           
        }
    },
    methods:{
        dragOverHandler(event) {
            //显示蒙版
            event.preventDefault();
        },
        dropFile(ev) {
            ev.preventDefault();
            // console.log(ev.dataTransfer)
            let file = null;
            if (ev.dataTransfer.items) {
              // Use DataTransferItemList interface to access the file(s)
              for (var i = 0; i < ev.dataTransfer.items.length; i++) {
                console.log(ev.dataTransfer.items[i].getAsFile());
                // If dropped items aren't files, reject them
                // if (ev.dataTransfer.items[i].kind === "file") {
                //   file = ev.dataTransfer.items[i].getAsFile();
                //   console.log("111... file[" + i + "].name = " + file.name);
                //   console.log(file)
                // }else{
                //   console.error(ev.dataTransfer.items[i])
                // }
              }
            } 
            // else {
            //   console.log("）））",ev.dataTransfer.files)
            //   // Use DataTransfer interface to access the file(s)
            //   for (var i = 0; i < ev.dataTransfer.files.length; i++) {
            //     console.log("222... file[" + i + "].name = " + ev.dataTransfer.files[i].name);
            //   }
            // }
        },
        uploadFile(file) {
            console.log(file)
        }
    },
    mounted(){
        
    }
}

export {
    Controller
};
